<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &gt;= 702
</span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if __GLASGOW_HASKELL__ &gt;= 710
</span><span class="hs-pragma">{-# LANGUAGE AutoDeriveTypeable #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">#if !(MIN_VERSION_base(4,9,0))
</span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-orphans #-}</span><span class="hs-cpp">
#endif
</span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Module      :  Control.Monad.Trans.Error</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Copyright   :  (c) Michael Weber &lt;michael.weber@post.rwth-aachen.de&gt; 2001,</span><span>
</span><span id="line-15"></span><span class="hs-comment">--                (c) Jeff Newbern 2003-2006,</span><span>
</span><span id="line-16"></span><span class="hs-comment">--                (c) Andriy Palamarchuk 2006</span><span>
</span><span id="line-17"></span><span class="hs-comment">-- License     :  BSD-style (see the file LICENSE)</span><span>
</span><span id="line-18"></span><span class="hs-comment">--</span><span>
</span><span id="line-19"></span><span class="hs-comment">-- Maintainer  :  R.Paterson@city.ac.uk</span><span>
</span><span id="line-20"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-21"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-22"></span><span class="hs-comment">--</span><span>
</span><span id="line-23"></span><span class="hs-comment">-- This monad transformer adds the ability to fail or throw exceptions</span><span>
</span><span id="line-24"></span><span class="hs-comment">-- to a monad.</span><span>
</span><span id="line-25"></span><span class="hs-comment">--</span><span>
</span><span id="line-26"></span><span class="hs-comment">-- A sequence of actions succeeds, producing a value, only if all the</span><span>
</span><span id="line-27"></span><span class="hs-comment">-- actions in the sequence are successful.  If one fails with an error,</span><span>
</span><span id="line-28"></span><span class="hs-comment">-- the rest of the sequence is skipped and the composite action fails</span><span>
</span><span id="line-29"></span><span class="hs-comment">-- with that error.</span><span>
</span><span id="line-30"></span><span class="hs-comment">--</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- If the value of the error is not required, the variant in</span><span>
</span><span id="line-32"></span><span class="hs-comment">-- &quot;Control.Monad.Trans.Maybe&quot; may be used instead.</span><span>
</span><span id="line-33"></span><span class="hs-comment">--</span><span>
</span><span id="line-34"></span><span class="hs-comment">-- /Note:/ This module will be removed in a future release.</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- Instead, use &quot;Control.Monad.Trans.Except&quot;, which does not restrict</span><span>
</span><span id="line-36"></span><span class="hs-comment">-- the exception type, and also includes a base exception monad.</span><span>
</span><span id="line-37"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Monad.Trans.Error</span><span>
</span><span id="line-40"></span><span>  </span><span class="hs-pragma">{-# DEPRECATED</span><span> </span><span class="hs-pragma">&quot;Use Control.Monad.Trans.Except instead&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-41"></span><span>    </span><span class="annot"><span class="hs-comment">-- * The ErrorT monad transformer</span></span><span>
</span><span id="line-42"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier">Error</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorList"><span class="hs-identifier">ErrorList</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier">ErrorT</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#mapErrorT"><span class="hs-identifier">mapErrorT</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-46"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Error operations</span></span><span>
</span><span id="line-47"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#throwError"><span class="hs-identifier">throwError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#catchError"><span class="hs-identifier">catchError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Lifting other operations</span></span><span>
</span><span id="line-50"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#liftCallCC"><span class="hs-identifier">liftCallCC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#liftListen"><span class="hs-identifier">liftListen</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-52"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#liftPass"><span class="hs-identifier">liftPass</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-53"></span><span>    </span><span class="annot"><span class="hs-comment">-- * Examples</span></span><span>
</span><span id="line-54"></span><span>    </span><span class="annot"><span class="hs-comment">-- $examples</span></span><span>
</span><span id="line-55"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-56"></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#"><span class="hs-identifier">Control.Monad.IO.Class</span></a></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html"><span class="hs-identifier">Control.Monad.Signatures</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Class.html"><span class="hs-identifier">Control.Monad.Trans.Class</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#"><span class="hs-identifier">Data.Functor.Classes</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,12,0)
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#"><span class="hs-identifier">Data.Functor.Contravariant</span></a></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Applicative.html#"><span class="hs-identifier">Control.Applicative</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Exception.html#"><span class="hs-identifier">Control.Exception</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier">IOException</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span class="hs-cpp">
#if MIN_VERSION_base(4,9,0)
</span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#"><span class="hs-identifier">Control.Monad.Fail</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Fail</span></span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#"><span class="hs-identifier">Control.Monad.Fix</span></a></span><span class="hs-cpp">
#if !(MIN_VERSION_base(4,6,0))
</span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">Control.Monad.Instances</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- deprecated from base-4.6</span><span class="hs-cpp">
#endif
</span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#"><span class="hs-identifier">Data.Foldable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier">Foldable</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#foldMap"><span class="hs-identifier">foldMap</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Monoid.html#"><span class="hs-identifier">Data.Monoid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier">mempty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#"><span class="hs-identifier">Data.Traversable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier">Traversable</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier">traverse</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/System.IO.Error.html#"><span class="hs-identifier">System.IO.Error</span></a></span><span class="hs-cpp">

#if !(MIN_VERSION_base(4,9,0))
</span><span class="hs-comment">-- These instances are in base-4.9.0</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">MonadPlus</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-84"></span><span>    </span><span class="hs-identifier">mzero</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ioError</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">userError</span><span> </span><span class="hs-string">&quot;mzero&quot;</span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span>    </span><span class="hs-identifier">m</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">mplus</span><span class="hs-special">`</span><span> </span><span class="hs-identifier">n</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">m</span><span> </span><span class="hs-special">`</span><span class="hs-identifier">catchIOError</span><span class="hs-special">`</span><span> </span><span class="hs-glyph">\</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">n</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Alternative</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-identifier">empty</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mzero</span><span>
</span><span id="line-89"></span><span>    </span><span class="hs-special">(</span><span class="hs-operator">&lt;|&gt;</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">mplus</span><span class="hs-cpp">

# if !(MIN_VERSION_base(4,4,0))
</span><span class="hs-comment">-- exported by System.IO.Error from base-4.4</span><span>
</span><span id="line-93"></span><span class="hs-identifier">catchIOError</span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">IOError</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">IO</span><span> </span><span class="hs-identifier">a</span><span>
</span><span id="line-94"></span><span class="hs-identifier">catchIOError</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">catch</span><span class="hs-cpp">
# endif
</span><span class="hs-cpp">#endif
</span><span>
</span><span id="line-98"></span><span id="local-6989586621679074279"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073858"><span id="local-6989586621679073860"><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074279"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074279"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-99"></span><span>    </span><span id="local-6989586621679073855"><span class="annot"><span class="annottext">empty :: forall a. Either e a
</span><a href="../../base/src/GHC.Base.html#empty"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
forall a. Error a =&gt; a
</span><a href="Control.Monad.Trans.Error.html#noMsg"><span class="hs-identifier hs-var">noMsg</span></a></span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679073852"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. Either e a -&gt; Either e a -&gt; Either e a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;|&gt;</span></a></span></span><span> </span><span id="local-6989586621679073850"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073850"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073850"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621679073849"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073849"><span class="hs-identifier hs-var">m</span></a></span></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Either e a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073849"><span class="hs-identifier hs-var">m</span></a></span></span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span id="local-6989586621679074267"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074267"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074267"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-104"></span><span>    </span><span id="local-6989586621679073837"><span class="annot"><span class="annottext">mzero :: forall a. Either e a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var hs-var hs-var hs-var">mzero</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
forall a. Error a =&gt; a
</span><a href="Control.Monad.Trans.Error.html#noMsg"><span class="hs-identifier hs-var">noMsg</span></a></span><span>
</span><span id="line-105"></span><span>    </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621679073835"><span class="annot"><span class="annottext">mplus :: forall a. Either e a -&gt; Either e a -&gt; Either e a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-operator hs-var hs-var hs-var hs-var">`mplus`</span></a></span></span><span> </span><span id="local-6989586621679073833"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073833"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073833"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-106"></span><span>    </span><span id="local-6989586621679073832"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073832"><span class="hs-identifier hs-var">m</span></a></span></span><span>      </span><span class="annot"><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-operator hs-var">`mplus`</span></a></span><span> </span><span class="annot"><span class="annottext">Either e a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073832"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-cpp">

#if !(MIN_VERSION_base(4,3,0))
</span><span class="hs-comment">-- These instances are in base-4.3</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Applicative</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">e</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-112"></span><span>    </span><span class="hs-identifier">pure</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Right</span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-identifier">Left</span><span>  </span><span class="hs-identifier">e</span><span> </span><span class="hs-operator">&lt;*&gt;</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Left</span><span> </span><span class="hs-identifier">e</span><span>
</span><span id="line-114"></span><span>    </span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">f</span><span> </span><span class="hs-operator">&lt;*&gt;</span><span> </span><span class="hs-identifier">r</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">fmap</span><span> </span><span class="hs-identifier">f</span><span> </span><span class="hs-identifier">r</span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">Monad</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">e</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-117"></span><span>    </span><span class="hs-identifier">return</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Right</span><span>
</span><span id="line-118"></span><span>    </span><span class="hs-identifier">Left</span><span>  </span><span class="hs-identifier">l</span><span> </span><span class="hs-operator">&gt;&gt;=</span><span> </span><span class="hs-identifier">_</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">Left</span><span> </span><span class="hs-identifier">l</span><span>
</span><span id="line-119"></span><span>    </span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">r</span><span> </span><span class="hs-operator">&gt;&gt;=</span><span> </span><span class="hs-identifier">k</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">k</span><span> </span><span class="hs-identifier">r</span><span>
</span><span id="line-120"></span><span>
</span><span id="line-121"></span><span class="hs-keyword">instance</span><span> </span><span class="hs-identifier">MonadFix</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Either</span><span> </span><span class="hs-identifier">e</span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-identifier">mfix</span><span> </span><span class="hs-identifier">f</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-123"></span><span>        </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">f</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-124"></span><span>            </span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">r</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">r</span><span>
</span><span id="line-125"></span><span>            </span><span class="hs-identifier">_</span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-identifier">error</span><span> </span><span class="hs-string">&quot;empty mfix argument&quot;</span><span>
</span><span id="line-126"></span><span>        </span><span class="hs-keyword">in</span><span> </span><span class="hs-identifier">a</span><span class="hs-cpp">

#endif /* base to 4.2.0.x */
</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- | An exception to be thrown.</span><span>
</span><span id="line-131"></span><span class="hs-comment">--</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- Minimal complete definition: 'noMsg' or 'strMsg'.</span><span>
</span><span id="line-133"></span><span class="hs-keyword">class</span><span> </span><span id="Error"><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-var">Error</span></a></span></span><span> </span><span id="local-6989586621679074275"><span class="annot"><a href="#local-6989586621679074275"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-134"></span><span>    </span><span class="hs-comment">-- | Creates an exception without a message.</span><span>
</span><span id="line-135"></span><span>    </span><span class="hs-comment">-- The default implementation is @'strMsg' \&quot;\&quot;@.</span><span>
</span><span id="line-136"></span><span>    </span><span id="noMsg"><span class="annot"><a href="Control.Monad.Trans.Error.html#noMsg"><span class="hs-identifier hs-type">noMsg</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679074275"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-137"></span><span>    </span><span class="hs-comment">-- | Creates an exception with a message.</span><span>
</span><span id="line-138"></span><span>    </span><span class="hs-comment">-- The default implementation of @'strMsg' s@ is 'noMsg'.</span><span>
</span><span id="line-139"></span><span>    </span><span id="strMsg"><span class="annot"><a href="Control.Monad.Trans.Error.html#strMsg"><span class="hs-identifier hs-type">strMsg</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679074275"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span>    </span><span id="local-6989586621679073829"><span class="annot"><a href="Control.Monad.Trans.Error.html#noMsg"><span class="hs-identifier hs-var hs-var">noMsg</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. Error a =&gt; String -&gt; a
</span><a href="Control.Monad.Trans.Error.html#strMsg"><span class="hs-identifier hs-var">strMsg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span></span><span>
</span><span id="line-142"></span><span>    </span><span id="local-6989586621679073827"><span class="annot"><a href="Control.Monad.Trans.Error.html#strMsg"><span class="hs-identifier hs-var hs-var">strMsg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a
forall a. Error a =&gt; a
</span><a href="Control.Monad.Trans.Error.html#noMsg"><span class="hs-identifier hs-var">noMsg</span></a></span></span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073824"><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="../../base/src/GHC.IO.Exception.html#IOException"><span class="hs-identifier hs-type">IOException</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-145"></span><span>    </span><span id="local-6989586621679073821"><span class="annot"><span class="annottext">strMsg :: String -&gt; IOException
</span><a href="#local-6989586621679073821"><span class="hs-identifier hs-var hs-var hs-var hs-var">strMsg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IOException
</span><a href="../../base/src/GHC.IO.Exception.html#userError"><span class="hs-identifier hs-var">userError</span></a></span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="hs-comment">-- | A string can be thrown as an error.</span><span>
</span><span id="line-148"></span><span id="local-6989586621679074264"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073818"><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorList"><span class="hs-identifier hs-type">ErrorList</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074264"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679074264"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-149"></span><span>    </span><span id="local-6989586621679073815"><span class="annot"><span class="annottext">strMsg :: String -&gt; [a]
</span><a href="#local-6989586621679073815"><span class="hs-identifier hs-var hs-var hs-var hs-var">strMsg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; [a]
forall a. ErrorList a =&gt; String -&gt; [a]
</span><a href="Control.Monad.Trans.Error.html#listMsg"><span class="hs-identifier hs-var">listMsg</span></a></span></span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-comment">-- | Workaround so that we can have a Haskell 98 instance @'Error' 'String'@.</span><span>
</span><span id="line-152"></span><span class="hs-keyword">class</span><span> </span><span id="ErrorList"><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorList"><span class="hs-identifier hs-var">ErrorList</span></a></span></span><span> </span><span id="local-6989586621679074263"><span class="annot"><a href="#local-6989586621679074263"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-153"></span><span>    </span><span id="listMsg"><span class="annot"><a href="Control.Monad.Trans.Error.html#listMsg"><span class="hs-identifier hs-type">listMsg</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679074263"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-154"></span><span>
</span><span id="line-155"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorList"><span class="hs-identifier hs-type">ErrorList</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-156"></span><span>    </span><span id="local-6989586621679073810"><span class="annot"><span class="annottext">listMsg :: String -&gt; String
</span><a href="#local-6989586621679073810"><span class="hs-identifier hs-var hs-var hs-var hs-var">listMsg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; String
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- | The error monad transformer. It can be used to add error handling</span><span>
</span><span id="line-159"></span><span class="hs-comment">-- to other monads.</span><span>
</span><span id="line-160"></span><span class="hs-comment">--</span><span>
</span><span id="line-161"></span><span class="hs-comment">-- The @ErrorT@ Monad structure is parameterized over two things:</span><span>
</span><span id="line-162"></span><span class="hs-comment">--</span><span>
</span><span id="line-163"></span><span class="hs-comment">-- * e - The error type.</span><span>
</span><span id="line-164"></span><span class="hs-comment">--</span><span>
</span><span id="line-165"></span><span class="hs-comment">-- * m - The inner monad.</span><span>
</span><span id="line-166"></span><span class="hs-comment">--</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- The 'return' function yields a successful computation, while @&gt;&gt;=@</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- sequences two subcomputations, failing on the first error.</span><span>
</span><span id="line-169"></span><span class="hs-keyword">newtype</span><span> </span><span id="ErrorT"><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span></span><span> </span><span id="local-6989586621679074261"><span class="annot"><a href="#local-6989586621679074261"><span class="hs-identifier hs-type">e</span></a></span></span><span> </span><span id="local-6989586621679074260"><span class="annot"><a href="#local-6989586621679074260"><span class="hs-identifier hs-type">m</span></a></span></span><span> </span><span id="local-6989586621679074259"><span class="annot"><a href="#local-6989586621679074259"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="ErrorT"><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="runErrorT"><span class="annot"><span class="annottext">forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="#local-6989586621679074260"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074261"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074259"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-170"></span><span>
</span><span id="line-171"></span><span id="local-6989586621679074249"><span id="local-6989586621679074250"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679074250"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Eq1"><span class="hs-identifier hs-type">Eq1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074249"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Eq1"><span class="hs-identifier hs-type">Eq1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074250"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074249"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-172"></span><span>    </span><span id="local-6989586621679073798"><span class="annot"><span class="annottext">liftEq :: forall a b.
(a -&gt; b -&gt; Bool) -&gt; ErrorT e m a -&gt; ErrorT e m b -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#liftEq"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftEq</span></a></span></span><span> </span><span id="local-6989586621679073796"><span class="annot"><span class="annottext">a -&gt; b -&gt; Bool
</span><a href="#local-6989586621679073796"><span class="hs-identifier hs-var">eq</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679073795"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073795"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679073794"><span class="annot"><span class="annottext">m (Either e b)
</span><a href="#local-6989586621679073794"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Either e a -&gt; Either e b -&gt; Bool)
-&gt; m (Either e a) -&gt; m (Either e b) -&gt; Bool
forall (f :: * -&gt; *) a b.
Eq1 f =&gt;
(a -&gt; b -&gt; Bool) -&gt; f a -&gt; f b -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#liftEq"><span class="hs-identifier hs-var">liftEq</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b -&gt; Bool) -&gt; Either e a -&gt; Either e b -&gt; Bool
forall (f :: * -&gt; *) a b.
Eq1 f =&gt;
(a -&gt; b -&gt; Bool) -&gt; f a -&gt; f b -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#liftEq"><span class="hs-identifier hs-var">liftEq</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; Bool
</span><a href="#local-6989586621679073796"><span class="hs-identifier hs-var">eq</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073795"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e b)
</span><a href="#local-6989586621679073794"><span class="hs-identifier hs-var">y</span></a></span></span></span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span id="local-6989586621679074238"><span id="local-6989586621679074239"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621679074239"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Ord1"><span class="hs-identifier hs-type">Ord1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074238"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Ord1"><span class="hs-identifier hs-type">Ord1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074239"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074238"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-175"></span><span>    </span><span id="local-6989586621679073781"><span class="annot"><span class="annottext">liftCompare :: forall a b.
(a -&gt; b -&gt; Ordering) -&gt; ErrorT e m a -&gt; ErrorT e m b -&gt; Ordering
</span><a href="../../base/src/Data.Functor.Classes.html#liftCompare"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftCompare</span></a></span></span><span> </span><span id="local-6989586621679073779"><span class="annot"><span class="annottext">a -&gt; b -&gt; Ordering
</span><a href="#local-6989586621679073779"><span class="hs-identifier hs-var">comp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679073778"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073778"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679073777"><span class="annot"><span class="annottext">m (Either e b)
</span><a href="#local-6989586621679073777"><span class="hs-identifier hs-var">y</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Either e a -&gt; Either e b -&gt; Ordering)
-&gt; m (Either e a) -&gt; m (Either e b) -&gt; Ordering
forall (f :: * -&gt; *) a b.
Ord1 f =&gt;
(a -&gt; b -&gt; Ordering) -&gt; f a -&gt; f b -&gt; Ordering
</span><a href="../../base/src/Data.Functor.Classes.html#liftCompare"><span class="hs-identifier hs-var">liftCompare</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b -&gt; Ordering) -&gt; Either e a -&gt; Either e b -&gt; Ordering
forall (f :: * -&gt; *) a b.
Ord1 f =&gt;
(a -&gt; b -&gt; Ordering) -&gt; f a -&gt; f b -&gt; Ordering
</span><a href="../../base/src/Data.Functor.Classes.html#liftCompare"><span class="hs-identifier hs-var">liftCompare</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b -&gt; Ordering
</span><a href="#local-6989586621679073779"><span class="hs-identifier hs-var">comp</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073778"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e b)
</span><a href="#local-6989586621679073777"><span class="hs-identifier hs-var">y</span></a></span></span></span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span id="local-6989586621679074226"><span id="local-6989586621679074227"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073770"><span id="local-6989586621679073772"><span id="local-6989586621679073774"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074227"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Read1"><span class="hs-identifier hs-type">Read1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074226"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Read1"><span class="hs-identifier hs-type">Read1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074227"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074226"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-178"></span><span>    </span><span id="local-6989586621679073767"><span class="annot"><span class="annottext">liftReadsPrec :: forall a.
(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; Int -&gt; ReadS (ErrorT e m a)
</span><a href="../../base/src/Data.Functor.Classes.html#liftReadsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftReadsPrec</span></a></span></span><span> </span><span id="local-6989586621679073765"><span class="annot"><span class="annottext">Int -&gt; ReadS a
</span><a href="#local-6989586621679073765"><span class="hs-identifier hs-var">rp</span></a></span></span><span> </span><span id="local-6989586621679073764"><span class="annot"><span class="annottext">ReadS [a]
</span><a href="#local-6989586621679073764"><span class="hs-identifier hs-var">rl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; ReadS (ErrorT e m a)) -&gt; Int -&gt; ReadS (ErrorT e m a)
forall a. (String -&gt; ReadS a) -&gt; Int -&gt; ReadS a
</span><a href="../../base/src/Data.Functor.Classes.html#readsData"><span class="hs-identifier hs-var">readsData</span></a></span><span> </span><span class="annot"><span class="annottext">((String -&gt; ReadS (ErrorT e m a)) -&gt; Int -&gt; ReadS (ErrorT e m a))
-&gt; (String -&gt; ReadS (ErrorT e m a)) -&gt; Int -&gt; ReadS (ErrorT e m a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-179"></span><span>        </span><span class="annot"><span class="annottext">(Int -&gt; ReadS (m (Either e a)))
-&gt; String
-&gt; (m (Either e a) -&gt; ErrorT e m a)
-&gt; String
-&gt; ReadS (ErrorT e m a)
forall a t.
(Int -&gt; ReadS a) -&gt; String -&gt; (a -&gt; t) -&gt; String -&gt; ReadS t
</span><a href="../../base/src/Data.Functor.Classes.html#readsUnaryWith"><span class="hs-identifier hs-var">readsUnaryWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int -&gt; ReadS (Either e a))
-&gt; ReadS [Either e a] -&gt; Int -&gt; ReadS (m (Either e a))
forall (f :: * -&gt; *) a.
Read1 f =&gt;
(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; Int -&gt; ReadS (f a)
</span><a href="../../base/src/Data.Functor.Classes.html#liftReadsPrec"><span class="hs-identifier hs-var">liftReadsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS (Either e a)
</span><a href="#local-6989586621679073761"><span class="hs-identifier hs-var">rp'</span></a></span><span> </span><span class="annot"><span class="annottext">ReadS [Either e a]
</span><a href="#local-6989586621679073760"><span class="hs-identifier hs-var">rl'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ErrorT&quot;</span></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span>
</span><span id="line-180"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-181"></span><span>        </span><span id="local-6989586621679073761"><span class="annot"><span class="annottext">rp' :: Int -&gt; ReadS (Either e a)
</span><a href="#local-6989586621679073761"><span class="hs-identifier hs-var hs-var">rp'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; Int -&gt; ReadS (Either e a)
forall (f :: * -&gt; *) a.
Read1 f =&gt;
(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; Int -&gt; ReadS (f a)
</span><a href="../../base/src/Data.Functor.Classes.html#liftReadsPrec"><span class="hs-identifier hs-var">liftReadsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS a
</span><a href="#local-6989586621679073765"><span class="hs-identifier hs-var">rp</span></a></span><span> </span><span class="annot"><span class="annottext">ReadS [a]
</span><a href="#local-6989586621679073764"><span class="hs-identifier hs-var">rl</span></a></span><span>
</span><span id="line-182"></span><span>        </span><span id="local-6989586621679073760"><span class="annot"><span class="annottext">rl' :: ReadS [Either e a]
</span><a href="#local-6989586621679073760"><span class="hs-identifier hs-var hs-var">rl'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; ReadS [Either e a]
forall (f :: * -&gt; *) a.
Read1 f =&gt;
(Int -&gt; ReadS a) -&gt; ReadS [a] -&gt; ReadS [f a]
</span><a href="../../base/src/Data.Functor.Classes.html#liftReadList"><span class="hs-identifier hs-var">liftReadList</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS a
</span><a href="#local-6989586621679073765"><span class="hs-identifier hs-var">rp</span></a></span><span> </span><span class="annot"><span class="annottext">ReadS [a]
</span><a href="#local-6989586621679073764"><span class="hs-identifier hs-var">rl</span></a></span></span></span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span id="local-6989586621679074213"><span id="local-6989586621679074214"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073753"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074214"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Show1"><span class="hs-identifier hs-type">Show1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074213"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Show1"><span class="hs-identifier hs-type">Show1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074214"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074213"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-185"></span><span>    </span><span id="local-6989586621679073750"><span class="annot"><span class="annottext">liftShowsPrec :: forall a.
(Int -&gt; a -&gt; String -&gt; String)
-&gt; ([a] -&gt; String -&gt; String)
-&gt; Int
-&gt; ErrorT e m a
-&gt; String
-&gt; String
</span><a href="../../base/src/Data.Functor.Classes.html#liftShowsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftShowsPrec</span></a></span></span><span> </span><span id="local-6989586621679073748"><span class="annot"><span class="annottext">Int -&gt; a -&gt; String -&gt; String
</span><a href="#local-6989586621679073748"><span class="hs-identifier hs-var">sp</span></a></span></span><span> </span><span id="local-6989586621679073747"><span class="annot"><span class="annottext">[a] -&gt; String -&gt; String
</span><a href="#local-6989586621679073747"><span class="hs-identifier hs-var">sl</span></a></span></span><span> </span><span id="local-6989586621679073746"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679073746"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679073745"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073745"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-186"></span><span>        </span><span class="annot"><span class="annottext">(Int -&gt; m (Either e a) -&gt; String -&gt; String)
-&gt; String -&gt; Int -&gt; m (Either e a) -&gt; String -&gt; String
forall a.
(Int -&gt; a -&gt; String -&gt; String)
-&gt; String -&gt; Int -&gt; a -&gt; String -&gt; String
</span><a href="../../base/src/Data.Functor.Classes.html#showsUnaryWith"><span class="hs-identifier hs-var">showsUnaryWith</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Int -&gt; Either e a -&gt; String -&gt; String)
-&gt; ([Either e a] -&gt; String -&gt; String)
-&gt; Int
-&gt; m (Either e a)
-&gt; String
-&gt; String
forall (f :: * -&gt; *) a.
Show1 f =&gt;
(Int -&gt; a -&gt; String -&gt; String)
-&gt; ([a] -&gt; String -&gt; String) -&gt; Int -&gt; f a -&gt; String -&gt; String
</span><a href="../../base/src/Data.Functor.Classes.html#liftShowsPrec"><span class="hs-identifier hs-var">liftShowsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Either e a -&gt; String -&gt; String
</span><a href="#local-6989586621679073743"><span class="hs-identifier hs-var">sp'</span></a></span><span> </span><span class="annot"><span class="annottext">[Either e a] -&gt; String -&gt; String
</span><a href="#local-6989586621679073742"><span class="hs-identifier hs-var">sl'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;ErrorT&quot;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679073746"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073745"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-187"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-188"></span><span>        </span><span id="local-6989586621679073743"><span class="annot"><span class="annottext">sp' :: Int -&gt; Either e a -&gt; String -&gt; String
</span><a href="#local-6989586621679073743"><span class="hs-identifier hs-var hs-var">sp'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; a -&gt; String -&gt; String)
-&gt; ([a] -&gt; String -&gt; String)
-&gt; Int
-&gt; Either e a
-&gt; String
-&gt; String
forall (f :: * -&gt; *) a.
Show1 f =&gt;
(Int -&gt; a -&gt; String -&gt; String)
-&gt; ([a] -&gt; String -&gt; String) -&gt; Int -&gt; f a -&gt; String -&gt; String
</span><a href="../../base/src/Data.Functor.Classes.html#liftShowsPrec"><span class="hs-identifier hs-var">liftShowsPrec</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; a -&gt; String -&gt; String
</span><a href="#local-6989586621679073748"><span class="hs-identifier hs-var">sp</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; String -&gt; String
</span><a href="#local-6989586621679073747"><span class="hs-identifier hs-var">sl</span></a></span><span>
</span><span id="line-189"></span><span>        </span><span id="local-6989586621679073742"><span class="annot"><span class="annottext">sl' :: [Either e a] -&gt; String -&gt; String
</span><a href="#local-6989586621679073742"><span class="hs-identifier hs-var hs-var">sl'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; a -&gt; String -&gt; String)
-&gt; ([a] -&gt; String -&gt; String) -&gt; [Either e a] -&gt; String -&gt; String
forall (f :: * -&gt; *) a.
Show1 f =&gt;
(Int -&gt; a -&gt; String -&gt; String)
-&gt; ([a] -&gt; String -&gt; String) -&gt; [f a] -&gt; String -&gt; String
</span><a href="../../base/src/Data.Functor.Classes.html#liftShowList"><span class="hs-identifier hs-var">liftShowList</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; a -&gt; String -&gt; String
</span><a href="#local-6989586621679073748"><span class="hs-identifier hs-var">sp</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; String -&gt; String
</span><a href="#local-6989586621679073747"><span class="hs-identifier hs-var">sl</span></a></span></span></span><span>
</span><span id="line-190"></span><span>
</span><span id="line-191"></span><span id="local-6989586621679074206"><span id="local-6989586621679074207"><span id="local-6989586621679074208"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073735"><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679074208"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Eq1"><span class="hs-identifier hs-type">Eq1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074207"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="annot"><a href="#local-6989586621679074206"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Eq</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074208"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074207"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074206"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679073731"><span class="annot"><span class="annottext">== :: ErrorT e m a -&gt; ErrorT e m a -&gt; Bool
</span><span class="hs-operator hs-var hs-var hs-var hs-var">(==)</span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; ErrorT e m a -&gt; Bool
forall (f :: * -&gt; *) a. (Eq1 f, Eq a) =&gt; f a -&gt; f a -&gt; Bool
</span><a href="../../base/src/Data.Functor.Classes.html#eq1"><span class="hs-identifier hs-var">eq1</span></a></span></span></span></span><span>
</span><span id="line-192"></span><span id="local-6989586621679074201"><span id="local-6989586621679074202"><span id="local-6989586621679074203"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073715"><span id="local-6989586621679073717"><span id="local-6989586621679073719"><span id="local-6989586621679073721"><span id="local-6989586621679073723"><span id="local-6989586621679073725"><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621679074203"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Ord1"><span class="hs-identifier hs-type">Ord1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074202"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="annot"><a href="#local-6989586621679074201"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Ord</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074203"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074202"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074201"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679073711"><span class="annot"><span class="annottext">compare :: ErrorT e m a -&gt; ErrorT e m a -&gt; Ordering
</span><span class="hs-identifier hs-var hs-var hs-var hs-var">compare</span></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; ErrorT e m a -&gt; Ordering
forall (f :: * -&gt; *) a. (Ord1 f, Ord a) =&gt; f a -&gt; f a -&gt; Ordering
</span><a href="../../base/src/Data.Functor.Classes.html#compare1"><span class="hs-identifier hs-var">compare1</span></a></span></span></span></span><span>
</span><span id="line-193"></span><span id="local-6989586621679074195"><span id="local-6989586621679074196"><span id="local-6989586621679074197"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073702"><span id="local-6989586621679073704"><span id="local-6989586621679073706"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074197"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Read1"><span class="hs-identifier hs-type">Read1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074196"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074195"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Read.html#Read"><span class="hs-identifier hs-type">Read</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074197"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074196"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074195"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-194"></span><span>    </span><span id="local-6989586621679073698"><span class="annot"><span class="annottext">readsPrec :: Int -&gt; ReadS (ErrorT e m a)
</span><a href="../../base/src/GHC.Read.html#readsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">readsPrec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ReadS (ErrorT e m a)
forall (f :: * -&gt; *) a. (Read1 f, Read a) =&gt; Int -&gt; ReadS (f a)
</span><a href="../../base/src/Data.Functor.Classes.html#readsPrec1"><span class="hs-identifier hs-var">readsPrec1</span></a></span></span></span></span><span>
</span><span id="line-195"></span><span id="local-6989586621679074189"><span id="local-6989586621679074190"><span id="local-6989586621679074191"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073691"><span id="local-6989586621679073693"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074191"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Classes.html#Show1"><span class="hs-identifier hs-type">Show1</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074190"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074189"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074191"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074190"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074189"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-196"></span><span>    </span><span id="local-6989586621679073687"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; ErrorT e m a -&gt; String -&gt; String
</span><a href="../../base/src/GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; ErrorT e m a -&gt; String -&gt; String
forall (f :: * -&gt; *) a.
(Show1 f, Show a) =&gt;
Int -&gt; f a -&gt; String -&gt; String
</span><a href="../../base/src/Data.Functor.Classes.html#showsPrec1"><span class="hs-identifier hs-var">showsPrec1</span></a></span></span></span></span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span class="hs-comment">-- | Map the unwrapped computation using the given function.</span><span>
</span><span id="line-199"></span><span class="hs-comment">--</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- * @'runErrorT' ('mapErrorT' f m) = f ('runErrorT' m)@</span><span>
</span><span id="line-201"></span><span id="local-6989586621679074181"><span id="local-6989586621679074182"><span id="local-6989586621679074183"><span id="local-6989586621679074184"><span id="local-6989586621679074185"><span id="local-6989586621679074186"><span class="annot"><a href="Control.Monad.Trans.Error.html#mapErrorT"><span class="hs-identifier hs-type">mapErrorT</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679074186"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074185"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074184"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679074183"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074182"><span class="hs-identifier hs-type">e'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074181"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-202"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074185"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074186"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074184"><span class="hs-identifier hs-type">a</span></a></span><span>
</span><span id="line-203"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074182"><span class="hs-identifier hs-type">e'</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074183"><span class="hs-identifier hs-type">n</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074181"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span></span></span><span>
</span><span id="line-204"></span><span id="mapErrorT"><span class="annot"><span class="annottext">mapErrorT :: forall (m :: * -&gt; *) e a (n :: * -&gt; *) e' b.
(m (Either e a) -&gt; n (Either e' b))
-&gt; ErrorT e m a -&gt; ErrorT e' n b
</span><a href="Control.Monad.Trans.Error.html#mapErrorT"><span class="hs-identifier hs-var hs-var">mapErrorT</span></a></span></span><span> </span><span id="local-6989586621679073684"><span class="annot"><span class="annottext">m (Either e a) -&gt; n (Either e' b)
</span><a href="#local-6989586621679073684"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679073683"><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073683"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">n (Either e' b) -&gt; ErrorT e' n b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(n (Either e' b) -&gt; ErrorT e' n b)
-&gt; n (Either e' b) -&gt; ErrorT e' n b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; n (Either e' b)
</span><a href="#local-6989586621679073684"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073683"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span id="local-6989586621679074168"><span id="local-6989586621679074169"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073680"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074169"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074168"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074169"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-207"></span><span>    </span><span id="local-6989586621679073675"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; ErrorT e m a -&gt; ErrorT e m b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679073674"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679073674"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ErrorT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ErrorT e m b)
-&gt; (ErrorT e m a -&gt; m (Either e b)) -&gt; ErrorT e m a -&gt; ErrorT e m b
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e a -&gt; Either e b) -&gt; m (Either e a) -&gt; m (Either e b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; b) -&gt; Either e a -&gt; Either e b
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679073674"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e b))
-&gt; (ErrorT e m a -&gt; m (Either e a))
-&gt; ErrorT e m a
-&gt; m (Either e b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span></span></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span id="local-6989586621679074145"><span id="local-6989586621679074146"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073640"><span id="local-6989586621679073642"><span id="local-6989586621679073644"><span id="local-6989586621679073646"><span id="local-6989586621679073648"><span id="local-6989586621679073650"><span id="local-6989586621679073652"><span id="local-6989586621679073654"><span id="local-6989586621679073656"><span id="local-6989586621679073658"><span id="local-6989586621679073660"><span id="local-6989586621679073662"><span id="local-6989586621679073664"><span id="local-6989586621679073666"><span id="local-6989586621679073668"><span id="local-6989586621679073671"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074146"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Foldable.html#Foldable"><span class="hs-identifier hs-type">Foldable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074145"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074146"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-210"></span><span>    </span><span id="local-6989586621679073634"><span class="annot"><span class="annottext">foldMap :: forall m a. Monoid m =&gt; (a -&gt; m) -&gt; ErrorT e f a -&gt; m
</span><a href="#local-6989586621679073634"><span class="hs-identifier hs-var hs-var hs-var hs-var">foldMap</span></a></span></span><span> </span><span id="local-6989586621679073633"><span class="annot"><span class="annottext">a -&gt; m
</span><a href="#local-6989586621679073633"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679073632"><span class="annot"><span class="annottext">f (Either e a)
</span><a href="#local-6989586621679073632"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Either e a -&gt; m) -&gt; f (Either e a) -&gt; m
forall (t :: * -&gt; *) m a.
(Foldable t, Monoid m) =&gt;
(a -&gt; m) -&gt; t a -&gt; m
</span><a href="../../base/src/Data.Foldable.html#foldMap"><span class="hs-identifier hs-var">foldMap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; m) -&gt; (a -&gt; m) -&gt; Either e a -&gt; m
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">m -&gt; e -&gt; m
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">m
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">a -&gt; m
</span><a href="#local-6989586621679073633"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f (Either e a)
</span><a href="#local-6989586621679073632"><span class="hs-identifier hs-var">a</span></a></span></span></span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span id="local-6989586621679074124"><span id="local-6989586621679074125"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073619"><span id="local-6989586621679073621"><span id="local-6989586621679073623"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074125"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Traversable.html#Traversable"><span class="hs-identifier hs-type">Traversable</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074124"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074125"><span class="hs-identifier hs-type">f</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-213"></span><span>    </span><span id="local-6989586621679073610"><span class="annot"><span class="annottext">traverse :: forall (f :: * -&gt; *) a b.
Applicative f =&gt;
(a -&gt; f b) -&gt; ErrorT e f a -&gt; f (ErrorT e f b)
</span><a href="#local-6989586621679073610"><span class="hs-identifier hs-var hs-var hs-var hs-var">traverse</span></a></span></span><span> </span><span id="local-6989586621679073609"><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621679073609"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span id="local-6989586621679073608"><span class="annot"><span class="annottext">f (Either e a)
</span><a href="#local-6989586621679073608"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-214"></span><span>        </span><span class="annot"><span class="annottext">f (Either e b) -&gt; ErrorT e f b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(f (Either e b) -&gt; ErrorT e f b)
-&gt; f (f (Either e b)) -&gt; f (ErrorT e f b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e a -&gt; f (Either e b))
-&gt; f (Either e a) -&gt; f (f (Either e b))
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; f (Either e b))
-&gt; (a -&gt; f (Either e b)) -&gt; Either e a -&gt; f (Either e b)
forall a c b. (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c
</span><a href="../../base/src/Data.Either.html#either"><span class="hs-identifier hs-var">either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Either e b -&gt; f (Either e b)
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e b -&gt; f (Either e b))
-&gt; (e -&gt; Either e b) -&gt; e -&gt; f (Either e b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Either e b
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(b -&gt; Either e b) -&gt; f b -&gt; f (Either e b)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">b -&gt; Either e b
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">(f b -&gt; f (Either e b)) -&gt; (a -&gt; f b) -&gt; a -&gt; f (Either e b)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; f b
</span><a href="#local-6989586621679073609"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">f (Either e a)
</span><a href="#local-6989586621679073608"><span class="hs-identifier hs-var">a</span></a></span></span></span><span>
</span><span id="line-215"></span><span>
</span><span id="line-216"></span><span id="local-6989586621679074105"><span id="local-6989586621679074106"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073597"><span id="local-6989586621679073599"><span id="local-6989586621679073601"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074106"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074106"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074105"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074106"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-217"></span><span>    </span><span id="local-6989586621679073594"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; ErrorT e m a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679073593"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073593"><span class="hs-identifier hs-var">a</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073593"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-218"></span><span>    </span><span id="local-6989586621679073587"><span class="annot"><span class="annottext">ErrorT e m (a -&gt; b)
</span><a href="#local-6989586621679073587"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679073586"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. ErrorT e m (a -&gt; b) -&gt; ErrorT e m a -&gt; ErrorT e m b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span id="local-6989586621679073585"><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073585"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ErrorT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ErrorT e m b) -&gt; m (Either e b) -&gt; ErrorT e m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-219"></span><span>        </span><span id="local-6989586621679073584"><span class="annot"><span class="annottext">Either e (a -&gt; b)
</span><a href="#local-6989586621679073584"><span class="hs-identifier hs-var">mf</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ErrorT e m (a -&gt; b) -&gt; m (Either e (a -&gt; b))
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m (a -&gt; b)
</span><a href="#local-6989586621679073587"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e (a -&gt; b)
</span><a href="#local-6989586621679073584"><span class="hs-identifier hs-var">mf</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-221"></span><span>            </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679073583"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073583"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e b -&gt; m (Either e b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e b
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073583"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span>            </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679073582"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679073582"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-223"></span><span>                </span><span id="local-6989586621679073581"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073581"><span class="hs-identifier hs-var">mv</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073585"><span class="hs-identifier hs-var">v</span></a></span><span>
</span><span id="line-224"></span><span>                </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073581"><span class="hs-identifier hs-var">mv</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-225"></span><span>                    </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679073580"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073580"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e b -&gt; m (Either e b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e b
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073580"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>                    </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679073579"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073579"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e b -&gt; m (Either e b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; Either e b
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679073582"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073579"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span></span><span>
</span><span id="line-227"></span><span>
</span><span id="line-228"></span><span id="local-6989586621679074098"><span id="local-6989586621679074099"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073571"><span id="local-6989586621679073573"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074099"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074099"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074098"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Alternative"><span class="hs-identifier hs-type">Alternative</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074098"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074099"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-229"></span><span>    </span><span id="local-6989586621679073568"><span class="annot"><span class="annottext">empty :: forall a. ErrorT e m a
</span><a href="#local-6989586621679073568"><span class="hs-identifier hs-var hs-var hs-var hs-var">empty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a
</span><a href="../../base/src/GHC.Base.html#mzero"><span class="hs-identifier hs-var">mzero</span></a></span><span>
</span><span id="line-230"></span><span>    </span><span id="local-6989586621679073566"><span class="annot"><span class="annottext">&lt;|&gt; :: forall a. ErrorT e m a -&gt; ErrorT e m a -&gt; ErrorT e m a
</span><a href="#local-6989586621679073566"><span class="hs-operator hs-var hs-var hs-var hs-var">(&lt;|&gt;)</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; ErrorT e m a -&gt; ErrorT e m a
forall (m :: * -&gt; *) a. MonadPlus m =&gt; m a -&gt; m a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#mplus"><span class="hs-identifier hs-var">mplus</span></a></span></span></span><span>
</span><span id="line-231"></span><span>
</span><span id="line-232"></span><span id="local-6989586621679074088"><span id="local-6989586621679074089"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073559"><span id="local-6989586621679073561"><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074089"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074088"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074088"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074089"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span></span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">
#if !(MIN_VERSION_base(4,8,0))
</span><span>    </span><span class="hs-identifier">return</span><span> </span><span class="hs-identifier">a</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ErrorT</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Right</span><span> </span><span class="hs-identifier">a</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span>    </span><span id="local-6989586621679073555"><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073555"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679073554"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. ErrorT e m a -&gt; (a -&gt; ErrorT e m b) -&gt; ErrorT e m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679073553"><span class="annot"><span class="annottext">a -&gt; ErrorT e m b
</span><a href="#local-6989586621679073553"><span class="hs-identifier hs-var">k</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ErrorT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ErrorT e m b) -&gt; m (Either e b) -&gt; ErrorT e m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-237"></span><span>        </span><span id="local-6989586621679073552"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073552"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073555"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-238"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073552"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-239"></span><span>            </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679073551"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073551"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e b -&gt; m (Either e b)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e b
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073551"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-240"></span><span>            </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679073550"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073550"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m b -&gt; m (Either e b)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; ErrorT e m b
</span><a href="#local-6989586621679073553"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073550"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span></span></span><span class="hs-cpp">
#if !(MIN_VERSION_base(4,13,0))
</span><span>    </span><span class="hs-identifier">fail</span><span> </span><span class="hs-identifier">msg</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ErrorT</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">return</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">Left</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">strMsg</span><span> </span><span class="hs-identifier">msg</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-cpp">
#endif
</span><span class="hs-cpp">
#if MIN_VERSION_base(4,9,0)
</span><span id="local-6989586621679074080"><span id="local-6989586621679074081"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074081"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074080"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fail.html#MonadFail"><span class="hs-identifier hs-type">Fail.MonadFail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074080"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074081"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-247"></span><span>    </span><span id="local-6989586621679073540"><span class="annot"><span class="annottext">fail :: forall a. String -&gt; ErrorT e m a
</span><a href="../../base/src/Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var hs-var hs-var hs-var">fail</span></a></span></span><span> </span><span id="local-6989586621679073539"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679073539"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; e
forall a. Error a =&gt; String -&gt; a
</span><a href="Control.Monad.Trans.Error.html#strMsg"><span class="hs-identifier hs-var">strMsg</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679073539"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-250"></span><span id="local-6989586621679074096"><span id="local-6989586621679074097"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074097"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074096"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#MonadPlus"><span class="hs-identifier hs-type">MonadPlus</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074096"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074097"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-251"></span><span>    </span><span id="local-6989586621679073526"><span class="annot"><span class="annottext">mzero :: forall a. ErrorT e m a
</span><a href="#local-6989586621679073526"><span class="hs-identifier hs-var hs-var hs-var hs-var">mzero</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
forall a. Error a =&gt; a
</span><a href="Control.Monad.Trans.Error.html#noMsg"><span class="hs-identifier hs-var">noMsg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-252"></span><span>    </span><span id="local-6989586621679073523"><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073523"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679073522"><span class="annot"><span class="annottext">mplus :: forall a. ErrorT e m a -&gt; ErrorT e m a -&gt; ErrorT e m a
</span><a href="#local-6989586621679073522"><span class="hs-operator hs-var hs-var hs-var hs-var">`mplus`</span></a></span></span><span> </span><span id="local-6989586621679073521"><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073521"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-253"></span><span>        </span><span id="local-6989586621679073520"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073520"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073523"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-254"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073520"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-255"></span><span>            </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span class="annot"><span class="annottext">e
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073521"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-256"></span><span>            </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679073519"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073519"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073519"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span id="local-6989586621679074069"><span id="local-6989586621679074070"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#MonadFix"><span class="hs-identifier hs-type">MonadFix</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074070"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074069"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.Fix.html#MonadFix"><span class="hs-identifier hs-type">MonadFix</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074069"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074070"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-259"></span><span>    </span><span id="local-6989586621679073506"><span class="annot"><span class="annottext">mfix :: forall a. (a -&gt; ErrorT e m a) -&gt; ErrorT e m a
</span><a href="../../base/src/Control.Monad.Fix.html#mfix"><span class="hs-identifier hs-var hs-var hs-var hs-var">mfix</span></a></span></span><span> </span><span id="local-6989586621679073505"><span class="annot"><span class="annottext">a -&gt; ErrorT e m a
</span><a href="#local-6989586621679073505"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e a -&gt; m (Either e a)) -&gt; m (Either e a)
forall (m :: * -&gt; *) a. MonadFix m =&gt; (a -&gt; m a) -&gt; m a
</span><a href="../../base/src/Control.Monad.Fix.html#mfix"><span class="hs-identifier hs-var">mfix</span></a></span><span> </span><span class="annot"><span class="annottext">((Either e a -&gt; m (Either e a)) -&gt; m (Either e a))
-&gt; (Either e a -&gt; m (Either e a)) -&gt; m (Either e a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679073504"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073504"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(ErrorT e m a -&gt; m (Either e a)) -&gt; ErrorT e m a -&gt; m (Either e a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; ErrorT e m a
</span><a href="#local-6989586621679073505"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; ErrorT e m a) -&gt; a -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073504"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-260"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679073503"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073503"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073503"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-261"></span><span>        </span><span class="annot"><span class="annottext">Either e a
</span><span class="hs-identifier">_</span></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;empty mfix argument&quot;</span></span></span></span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span id="local-6989586621679074059"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Class.html#MonadTrans"><span class="hs-identifier hs-type">MonadTrans</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074059"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-264"></span><span>    </span><span id="local-6989586621679073495"><span class="annot"><span class="annottext">lift :: forall (m :: * -&gt; *) a. Monad m =&gt; m a -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var hs-var hs-var hs-var">lift</span></a></span></span><span> </span><span id="local-6989586621679073493"><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679073493"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-265"></span><span>        </span><span id="local-6989586621679073492"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073492"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m a
</span><a href="#local-6989586621679073493"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-266"></span><span>        </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073492"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-267"></span><span>
</span><span id="line-268"></span><span id="local-6989586621679074050"><span id="local-6989586621679074051"><span class="hs-keyword">instance</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#Error"><span class="hs-identifier hs-type">Error</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074051"><span class="hs-identifier hs-type">e</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074050"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.IO.Class.html#MonadIO"><span class="hs-identifier hs-type">MonadIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074051"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074050"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-269"></span><span>    </span><span id="local-6989586621679073479"><span class="annot"><span class="annottext">liftIO :: forall a. IO a -&gt; ErrorT e m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var hs-var hs-var hs-var">liftIO</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m a -&gt; ErrorT e m a
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m a -&gt; ErrorT e m a) -&gt; (IO a -&gt; m a) -&gt; IO a -&gt; ErrorT e m a
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; m a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span></span></span><span class="hs-cpp">

#if MIN_VERSION_base(4,12,0)
</span><span id="local-6989586621679074042"><span id="local-6989586621679074043"><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679073475"><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#Contravariant"><span class="hs-identifier hs-type">Contravariant</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074043"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Functor.Contravariant.html#Contravariant"><span class="hs-identifier hs-type">Contravariant</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074042"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074043"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-273"></span><span>    </span><span id="local-6989586621679073471"><span class="annot"><span class="annottext">contramap :: forall a' a. (a' -&gt; a) -&gt; ErrorT e m a -&gt; ErrorT e m a'
</span><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-identifier hs-var hs-var hs-var hs-var">contramap</span></a></span></span><span> </span><span id="local-6989586621679073469"><span class="annot"><span class="annottext">a' -&gt; a
</span><a href="#local-6989586621679073469"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a') -&gt; ErrorT e m a'
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a') -&gt; ErrorT e m a')
-&gt; (ErrorT e m a -&gt; m (Either e a'))
-&gt; ErrorT e m a
-&gt; ErrorT e m a'
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e a' -&gt; Either e a) -&gt; m (Either e a) -&gt; m (Either e a')
forall (f :: * -&gt; *) a' a.
Contravariant f =&gt;
(a' -&gt; a) -&gt; f a -&gt; f a'
</span><a href="../../base/src/Data.Functor.Contravariant.html#contramap"><span class="hs-identifier hs-var">contramap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a' -&gt; a) -&gt; Either e a' -&gt; Either e a
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">a' -&gt; a
</span><a href="#local-6989586621679073469"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e a'))
-&gt; (ErrorT e m a -&gt; m (Either e a))
-&gt; ErrorT e m a
-&gt; m (Either e a')
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span></span></span><span class="hs-cpp">
#endif
</span><span>
</span><span id="line-276"></span><span class="hs-comment">-- | Signal an error value @e@.</span><span>
</span><span id="line-277"></span><span class="hs-comment">--</span><span>
</span><span id="line-278"></span><span class="hs-comment">-- * @'runErrorT' ('throwError' e) = 'return' ('Left' e)@</span><span>
</span><span id="line-279"></span><span class="hs-comment">--</span><span>
</span><span id="line-280"></span><span class="hs-comment">-- * @'throwError' e &gt;&gt;= m = 'throwError' e@</span><span>
</span><span id="line-281"></span><span id="local-6989586621679074037"><span id="local-6989586621679074038"><span id="local-6989586621679074039"><span class="annot"><a href="Control.Monad.Trans.Error.html#throwError"><span class="hs-identifier hs-type">throwError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074039"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679074038"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074038"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074039"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074037"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-282"></span><span id="throwError"><span class="annot"><span class="annottext">throwError :: forall (m :: * -&gt; *) e a. Monad m =&gt; e -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#throwError"><span class="hs-identifier hs-var hs-var">throwError</span></a></span></span><span> </span><span id="local-6989586621679073466"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073466"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073466"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-283"></span><span>
</span><span id="line-284"></span><span class="hs-comment">-- | Handle an error.</span><span>
</span><span id="line-285"></span><span class="hs-comment">--</span><span>
</span><span id="line-286"></span><span class="hs-comment">-- * @'catchError' h ('lift' m) = 'lift' m@</span><span>
</span><span id="line-287"></span><span class="hs-comment">--</span><span>
</span><span id="line-288"></span><span class="hs-comment">-- * @'catchError' h ('throwError' e) = h e@</span><span>
</span><span id="line-289"></span><span id="local-6989586621679074031"><span id="local-6989586621679074032"><span id="local-6989586621679074033"><span class="annot"><a href="Control.Monad.Trans.Error.html#catchError"><span class="hs-identifier hs-type">catchError</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074033"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-290"></span><span>    </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074032"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074033"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074031"><span class="hs-identifier hs-type">a</span></a></span><span>                </span><span class="hs-comment">-- ^ the inner computation</span><span>
</span><span id="line-291"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679074032"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074032"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074033"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074031"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- ^ a handler for errors in the inner</span><span>
</span><span id="line-292"></span><span>                                </span><span class="hs-comment">-- computation</span><span>
</span><span id="line-293"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074032"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074033"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074031"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-294"></span><span id="local-6989586621679073462"><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073462"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="catchError"><span class="annot"><span class="annottext">catchError :: forall (m :: * -&gt; *) e a.
Monad m =&gt;
ErrorT e m a -&gt; (e -&gt; ErrorT e m a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#catchError"><span class="hs-operator hs-var hs-var">`catchError`</span></a></span></span><span> </span><span id="local-6989586621679073461"><span class="annot"><span class="annottext">e -&gt; ErrorT e m a
</span><a href="#local-6989586621679073461"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-295"></span><span>    </span><span id="local-6989586621679073460"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073460"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">ErrorT e m a
</span><a href="#local-6989586621679073462"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-296"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073460"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-297"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679073459"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073459"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; ErrorT e m a
</span><a href="#local-6989586621679073461"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073459"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679073458"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073458"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073458"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>
</span><span id="line-300"></span><span class="hs-comment">-- | Lift a @callCC@ operation to the new monad.</span><span>
</span><span id="line-301"></span><span id="local-6989586621679074024"><span id="local-6989586621679074025"><span id="local-6989586621679074026"><span id="local-6989586621679074027"><span class="annot"><a href="Control.Monad.Trans.Error.html#liftCallCC"><span class="hs-identifier hs-type">liftCallCC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier hs-type">CallCC</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074027"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074026"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074025"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074026"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074024"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#CallCC"><span class="hs-identifier hs-type">CallCC</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074026"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074027"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679074025"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074024"><span class="hs-identifier hs-type">b</span></a></span></span></span></span></span><span>
</span><span id="line-302"></span><span id="liftCallCC"><span class="annot"><span class="annottext">liftCallCC :: forall (m :: * -&gt; *) e a b.
CallCC m (Either e a) (Either e b) -&gt; CallCC (ErrorT e m) a b
</span><a href="Control.Monad.Trans.Error.html#liftCallCC"><span class="hs-identifier hs-var hs-var">liftCallCC</span></a></span></span><span> </span><span id="local-6989586621679073457"><span class="annot"><span class="annottext">CallCC m (Either e a) (Either e b)
</span><a href="#local-6989586621679073457"><span class="hs-identifier hs-var">callCC</span></a></span></span><span> </span><span id="local-6989586621679073456"><span class="annot"><span class="annottext">(a -&gt; ErrorT e m b) -&gt; ErrorT e m a
</span><a href="#local-6989586621679073456"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">m (Either e a) -&gt; ErrorT e m a
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; ErrorT e m a) -&gt; m (Either e a) -&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-303"></span><span>    </span><span class="annot"><span class="annottext">CallCC m (Either e a) (Either e b)
</span><a href="#local-6989586621679073457"><span class="hs-identifier hs-var">callCC</span></a></span><span> </span><span class="annot"><span class="annottext">CallCC m (Either e a) (Either e b)
-&gt; CallCC m (Either e a) (Either e b)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679073455"><span class="annot"><span class="annottext">Either e a -&gt; m (Either e b)
</span><a href="#local-6989586621679073455"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-304"></span><span>    </span><span class="annot"><span class="annottext">ErrorT e m a -&gt; m (Either e a)
forall e (m :: * -&gt; *) a. ErrorT e m a -&gt; m (Either e a)
</span><a href="Control.Monad.Trans.Error.html#runErrorT"><span class="hs-identifier hs-var hs-var">runErrorT</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(a -&gt; ErrorT e m b) -&gt; ErrorT e m a
</span><a href="#local-6989586621679073456"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679073454"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073454"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">m (Either e b) -&gt; ErrorT e m b
forall e (m :: * -&gt; *) a. m (Either e a) -&gt; ErrorT e m a
</span><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-var">ErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">(m (Either e b) -&gt; ErrorT e m b) -&gt; m (Either e b) -&gt; ErrorT e m b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; m (Either e b)
</span><a href="#local-6989586621679073455"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073454"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span class="hs-comment">-- | Lift a @listen@ operation to the new monad.</span><span>
</span><span id="line-307"></span><span id="local-6989586621679074015"><span id="local-6989586621679074016"><span id="local-6989586621679074017"><span id="local-6989586621679074018"><span class="annot"><a href="Control.Monad.Trans.Error.html#liftListen"><span class="hs-identifier hs-type">liftListen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074018"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Listen"><span class="hs-identifier hs-type">Listen</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074017"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074018"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074016"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074015"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Listen"><span class="hs-identifier hs-type">Listen</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074017"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074016"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074018"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679074015"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-308"></span><span id="liftListen"><span class="annot"><span class="annottext">liftListen :: forall (m :: * -&gt; *) w e a.
Monad m =&gt;
Listen w m (Either e a) -&gt; Listen w (ErrorT e m) a
</span><a href="Control.Monad.Trans.Error.html#liftListen"><span class="hs-identifier hs-var hs-var">liftListen</span></a></span></span><span> </span><span id="local-6989586621679073449"><span class="annot"><span class="annottext">Listen w m (Either e a)
</span><a href="#local-6989586621679073449"><span class="hs-identifier hs-var">listen</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (Either e a) -&gt; m (Either e (a, w)))
-&gt; ErrorT e m a -&gt; ErrorT e m (a, w)
forall (m :: * -&gt; *) e a (n :: * -&gt; *) e' b.
(m (Either e a) -&gt; n (Either e' b))
-&gt; ErrorT e m a -&gt; ErrorT e' n b
</span><a href="Control.Monad.Trans.Error.html#mapErrorT"><span class="hs-identifier hs-var">mapErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (Either e a) -&gt; m (Either e (a, w)))
 -&gt; ErrorT e m a -&gt; ErrorT e m (a, w))
-&gt; (m (Either e a) -&gt; m (Either e (a, w)))
-&gt; ErrorT e m a
-&gt; ErrorT e m (a, w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679073448"><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073448"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-309"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679073447"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073447"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679073446"><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679073446"><span class="hs-identifier hs-var">w</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Listen w m (Either e a)
</span><a href="#local-6989586621679073449"><span class="hs-identifier hs-var">listen</span></a></span><span> </span><span class="annot"><span class="annottext">m (Either e a)
</span><a href="#local-6989586621679073448"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-310"></span><span>    </span><span class="annot"><span class="annottext">Either e (a, w) -&gt; m (Either e (a, w))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Either e (a, w) -&gt; m (Either e (a, w)))
-&gt; Either e (a, w) -&gt; m (Either e (a, w))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">(a -&gt; (a, w)) -&gt; Either e a -&gt; Either e (a, w)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679073444"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073444"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073444"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w
</span><a href="#local-6989586621679073446"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679073447"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span class="hs-comment">-- | Lift a @pass@ operation to the new monad.</span><span>
</span><span id="line-313"></span><span id="local-6989586621679074006"><span id="local-6989586621679074007"><span id="local-6989586621679074008"><span id="local-6989586621679074009"><span class="annot"><a href="Control.Monad.Trans.Error.html#liftPass"><span class="hs-identifier hs-type">liftPass</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074009"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Pass"><span class="hs-identifier hs-type">Pass</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074008"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074009"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074007"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074006"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Control.Monad.Signatures.html#Pass"><span class="hs-identifier hs-type">Pass</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074008"><span class="hs-identifier hs-type">w</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Monad.Trans.Error.html#ErrorT"><span class="hs-identifier hs-type">ErrorT</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074007"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679074009"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><a href="#local-6989586621679074006"><span class="hs-identifier hs-type">a</span></a></span></span></span></span></span><span>
</span><span id="line-314"></span><span id="liftPass"><span class="annot"><span class="annottext">liftPass :: forall (m :: * -&gt; *) w e a.
Monad m =&gt;
Pass w m (Either e a) -&gt; Pass w (ErrorT e m) a
</span><a href="Control.Monad.Trans.Error.html#liftPass"><span class="hs-identifier hs-var hs-var">liftPass</span></a></span></span><span> </span><span id="local-6989586621679073440"><span class="annot"><span class="annottext">Pass w m (Either e a)
</span><a href="#local-6989586621679073440"><span class="hs-identifier hs-var">pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(m (Either e (a, w -&gt; w)) -&gt; m (Either e a))
-&gt; ErrorT e m (a, w -&gt; w) -&gt; ErrorT e m a
forall (m :: * -&gt; *) e a (n :: * -&gt; *) e' b.
(m (Either e a) -&gt; n (Either e' b))
-&gt; ErrorT e m a -&gt; ErrorT e' n b
</span><a href="Control.Monad.Trans.Error.html#mapErrorT"><span class="hs-identifier hs-var">mapErrorT</span></a></span><span> </span><span class="annot"><span class="annottext">((m (Either e (a, w -&gt; w)) -&gt; m (Either e a))
 -&gt; ErrorT e m (a, w -&gt; w) -&gt; ErrorT e m a)
-&gt; (m (Either e (a, w -&gt; w)) -&gt; m (Either e a))
-&gt; ErrorT e m (a, w -&gt; w)
-&gt; ErrorT e m a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679073439"><span class="annot"><span class="annottext">m (Either e (a, w -&gt; w))
</span><a href="#local-6989586621679073439"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Pass w m (Either e a)
</span><a href="#local-6989586621679073440"><span class="hs-identifier hs-var">pass</span></a></span><span> </span><span class="annot"><span class="annottext">Pass w m (Either e a) -&gt; Pass w m (Either e a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-315"></span><span>    </span><span id="local-6989586621679073438"><span class="annot"><span class="annottext">Either e (a, w -&gt; w)
</span><a href="#local-6989586621679073438"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (Either e (a, w -&gt; w))
</span><a href="#local-6989586621679073439"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-316"></span><span>    </span><span class="annot"><span class="annottext">(Either e a, w -&gt; w) -&gt; m (Either e a, w -&gt; w)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((Either e a, w -&gt; w) -&gt; m (Either e a, w -&gt; w))
-&gt; (Either e a, w -&gt; w) -&gt; m (Either e a, w -&gt; w)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e (a, w -&gt; w)
</span><a href="#local-6989586621679073438"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-317"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679073437"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073437"><span class="hs-identifier hs-var">l</span></a></span></span><span>      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span>  </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679073437"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-318"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679073436"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073436"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679073435"><span class="annot"><span class="annottext">w -&gt; w
</span><a href="#local-6989586621679073435"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679073436"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">w -&gt; w
</span><a href="#local-6989586621679073435"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span class="hs-comment">{- $examples

Wrapping an IO action that can throw an error @e@:

&gt; type ErrorWithIO e a = ErrorT e IO a
&gt; ==&gt; ErrorT (IO (Either e a))

An IO monad wrapped in @StateT@ inside of @ErrorT@:

&gt; type ErrorAndStateWithIO e s a = ErrorT e (StateT s IO) a
&gt; ==&gt; ErrorT (StateT s IO (Either e a))
&gt; ==&gt; ErrorT (StateT (s -&gt; IO (Either e a,s)))

-}</span><span>
</span><span id="line-334"></span></pre></body></html>